import useRequest from "@/api/useRequest";
import {IPage} from "@/interface/modules/system";

export class civitaiController {

  static modelQuery(query:string): Promise<any>{
    return useRequest({
      url: "/civitai/model?query="+query,
      method: "get"
    })
  }

  static libModelQuery(query:string): Promise<any>{
    const data = {
      modelUrl: query
    }
    return useRequest({
      url: "/civitai/queryByLiblib",
      method: "post",
      data
    })
  }

  static searchLibModel(query:string): Promise<any>{
    return useRequest({
      url: "/civitai/searchLibModel?uuid="+query,
      method: "get",
    })
  }

  static modelImport(data:any): Promise<any>{
    return useRequest({
      url: "/civitai/importModel",
      method: "post",
      data
    })
  }


    static modelList(data:any ,pagination?: IPage): Promise<any>{
        return useRequest({
            url: "/civitai/getCivitaiModelList",
            method: "post",
            params: pagination,
            data
        })
    }


    static imageList(data:any): Promise<any>{
        return useRequest({
            url: "/civitai/getCivitaiImageList",
            method: "post",
            data
        })
    }

    static getImagePrompt(modelId?:string): Promise<any>{
        return useRequest({
            url: "/civitai/getImagePrompt?modelId="+modelId,
            method: "get"
        })
    }


}
